<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE HTML>
<html>
	
  <head>
    
    <title>流程管理</title>
<style>
	<!--
	table {
	table-layout: fixed;
	word-wrap:break-word;
	}
	td{
		
		word-break:break-all;
	}
	
	}
	//-->
</style>

  </script>
  </head>
  <base target="_self"></base>
  <body>
  <form id="enterflowForm" name="enterflowForm" onSubmit="return true;" action="managepurchaselistflow.action" method="POST" >
    <input type="hidden" id="flowCode" name="flowCode" value=""/>
    
    <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	
  	<tr valign="top">
  		<td>
  			<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	
    	<td width="100%">
    		<FONT size="6">流程管理</FONT> 
    		
    		
    	</td>
    </tr>
    
    <tr>
    	
     	
     	
     	<td valign="top" >
     <table border="0" cellpadding="0" cellspacing="5" width="100%" height="100%">
    	 <tr>
     		<td>
     	<s:fielderror id="errormessage" />
    	
		     	<table width="100%" height="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
		     		
		     		<tr>
		     			<td>流程信息  ID:
		     			
		     			
		     			
		     			
		     			<input id="kindid" name="kindid" value="" type="text" required="required" placeholder="进仓单ID" >
		     			<input type="hidden" id="kind" name="kind" value="<s:property value="kind"/>"/>
		     			
		     			<button type="button" onclick="openUrlForDialog('managepurchaselistflow.action?kindid='+ $('#kindid').attr('value') + '&kind=<s:property value="kind"/>');">切换流程信息 ID</button>
		     			<s:fielderror id="errormessage" />
		     			</td>
		     		</tr>
		     	</table>
     	</td>
     		</tr>
     	<tr>
     		<td>
     			<s:if test="state == 9">
     				<table border="0" cellpadding="0"  cellspacing="0" width="100%"  style= "border:1px solid #ffffff; border-bottom-color:#21a4dc;
    border-left-color:#21a4dc;border-right-color:#21a4dc;border-top-color:#21a4dc">
    
    					<tr>
    						<td align="center">
    						<font color="red" size="20">单据已经被取消流程作废!</font>
    						
    						
    						</td>
    					</tr>
    
   					 </table>
     			
     			</s:if>
     		
     		</td>
     	</tr> 
 <tr>
     		<td>
			
    	
			
	
	</td>
     		</tr>
     		 <tr>
     		<td>
     		
		
     	</td>
     	</tr>
     	<s:iterator id="flowValuelistMap" value="flowValuelistMap">
		<tr>
     		<td>
     		
     		<s:if test="#flowValuelistMap.key == flowValue">
     			<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:red;
	   			 border-left-color:red;border-right-color:red;border-top-color:red" width="100%">
	     			<s:iterator id="flowValuelist" value="#flowValuelistMap.value">
	     				<tr>
	     				
	     					<td align="center">
	     						ID: <s:property value="kindid"/> / <s:property value="#flowValuelist.cnname_flow"/> / <s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).username_recordlist"/>
	     					</td>
	 
	     				</tr>
	     				
	     				
	     			</s:iterator>
	     		</table>
     		</s:if>
     		<s:elseif test="#flowValuelistMap.key == flowNextValue">
     			<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:#21a4dc;
	   			 border-left-color:#21a4dc;border-right-color:#21a4dc;border-top-color:#21a4dc" width="100%">
	     			<s:iterator id="flowValuelist" value="#flowValuelistMap.value">
	     				<tr>
	     				
	     					<td align="center">
	     					<s:if test="#flowValuelist.function_flow != '' && #flowValuelist.function_flow != 'null'">
	     					
	     						<a href="javascript:openUrlForDialog('<%=basePath %>/<s:property value="#flowValuelist.function_flow"/>?kind=<s:property value="kind"/>&kindid=<s:property value="kindid"/>&flowCode=<s:property value="#flowValuelist.code_flow"/>');">
	     							<s:property value="#flowValuelist.cnname_flow"/>
	     						</a></s:if>
	     						
	     					<s:else>
	     						
	     						<a href="javascript:openUrlForDialog('managepurchaselistflow.action?flowCode=<s:property value="#flowValuelist.code_flow"/>&kind=<s:property value="kind"/>&kindid=<s:property value="kindid"/>');">
	     							<s:property value="#flowValuelist.cnname_flow"/>
	     						</a>
	     					</s:else>
	     					
	     					
     						
	     					</td>
	     				
	     				</tr>
	     				
	     				
	     			</s:iterator>
	     		</table>
     		
     		</s:elseif>
     		<s:else>
     		<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:#c0c0c0;
   			 border-left-color:#c0c0c0;border-right-color:#c0c0c0;border-top-color:#c0c0c0" width="100%">
     			<s:iterator id="flowValuelist" value="#flowValuelistMap.value">
     				<tr>
     				
     					<td align="center">
     					<s:if test="flowValuelistMapNoCancel.get(#flowValuelist.code_flow) == null">
     						<font color="#c0c0c0">
     							<s:property value="#flowValuelist.cnname_flow"/>
     						</font>
     						
     						
     						
     						
     					</s:if> 
     					<s:else>
     						
     						
	     						
     							<s:property value="#flowValuelist.cnname_flow"/> / <s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).username_recordlist"/>
     							/ 时间: <s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).date_recordlist"/> 
     						
     						
	     					
	     						
	     						<s:if test="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).doublevalue_recordlist!=0">
	     							 <font color="red">
	     							 费用:<s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).doublevalue_recordlist"/>
	     							 </font>
     							</s:if> 
     							
     						<s:if test="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).flowflag_recordlist == 1  && flowValuelistMapNoCancel.get(#flowValuelist.code_flow).useremail_recordlist == #session.operatorInfo.email_operator">
     						
     							<a href="javascript:openUrlForDialog('cancelpurchaselistflow.action?id=<s:property value="flowValuelistMapNoCancel.get(#flowValuelist.code_flow).id_recordlist"/>');">取消本次操作</a>
     						</s:if>
     							
     						
     					
     					</s:else> 
     					
     						</td>
     				
     				</tr>
     				
     				
     			</s:iterator>
     		</table>
     		</s:else>
     		
     		
     		</td>
     		
     	</tr>
     	</s:iterator>
     	</table>
     	
     	
     	
     	
	</td>
</tr>
</table>
  		
  		</td>
  	</tr>
  	
  	<tr>
  	 	<td>
  	 		<table>
  	 			<s:iterator id="recorlistMap" value="recorlistMap">
  	 			
  	 			<tr>
  	 				<td>
  	 				
  	 				
  	 					<s:if test="#recorlistMap.value.flowflag_recordlist==9">
     						<s>
     						
     							<s:property value="flowCodeMap.get(#recorlistMap.value.code_recordlist).cnname_flow"/> / <s:property value="#recorlistMap.value.username_recordlist"/>
     							/ 时间: <s:property value="#recorlistMap.value.date_recordlist"/> 
     						</s>
     						</s:if> 
     						<s:else>
     							<s:property value="flowCodeMap.get(#recorlistMap.value.code_recordlist).cnname_flow"/> / <s:property value="#recorlistMap.value.username_recordlist"/>
     							/ 时间: <s:property value="#recorlistMap.value.date_recordlist"/> 
     						</s:else>
     						
     						<s:property value="flowCodeMap.get(#recorlistMap.value.id_recordlist).doublevalue_recordlist"/> 
     						
     						<s:if test="flowValuelistMapNoCancel.get(#recorlistMap.value.code_recordlist).doublevalue_recordlist!=0">
     							 <font color="red">
     							 费用:<s:property value="#recorlistMap.value.doublevalue_recordlist"/>
     							 </font>
     						</s:if> 
     						
     						
  	 					
  	 				</td>
  	 			</tr>
  	 			</s:iterator>
  	 		</table>
  		</td>
  	</tr>
  	 <tr>
  	 	<td>备注: <input type="text" size="50" maxlength="255"/></td>
  	 </tr>
  	 
  </table>

  </form> 
  </body>
  <script type="text/javascript">
  	function enterFlowSubmit(flowCode){
		
  		enterflowForm['flowCode'].value = flowCode; 
  		enterflowForm['flowCode'].submit();
  	}

	function checkKindid(){
		num = document.getElementById("kindid").value;
		if(isNaN(num)){
			document.getElementById("kindid").value="";
			return;
		}

		openUrlForDialog('enterflow.action?kindid='+ num + '&kindid=<s:property value="kind"/>');
		//enterflowForm.submit();
  	}

	
  </script>
</html>
